<script setup lang="ts">
import { DataCheckboxProps } from '../type';

defineOptions({
	inheritAttrs: false,
});

const props = defineProps<DataCheckboxProps>();
</script>

<template>
	<unicloud-db class="w-full" v-slot:default="{ data, loading, error, options }" v-bind="props.ucloudDb">
		<n-spin :size="14" :show="loading">
			<n-checkbox-group v-bind="$attrs">
				<n-space item-style="display: flex;">
					<n-checkbox v-for="it in data" :value="it.value" :label="it.label" :key="it.value" />
				</n-space>
			</n-checkbox-group>
		</n-spin>
	</unicloud-db>
</template>
